/**
 * 
 */
package com.kgcx.schedule.rabbitmq.consumer;

import javax.annotation.Resource;

import com.kgcx.common.constant.Cons;
import com.kgcx.schedule.service.ScheduleImmediatelyPlanePickOrderService;
import com.kgcx.schedule.service.ScheduleImmediatelyTrainPickOrderService;
import com.kgcx.schedule.service.SchedulePlanPlanePickOrderService;
import com.kgcx.schedule.service.SchedulePlanTrainPickOrderService;
import com.kgcx.schedule.service.SchedulePlanPlaneSendOrderService;
import com.kgcx.schedule.service.SchedulePlanTrainSendOrderService;
import com.kgcx.schedule.service.SchedulePlanCommonOrderService;
import com.kgcx.schedule.service.ScheduleImmediatelyCommonOrderService;
import com.kgcx.schedule.service.ScheduleOrderService;

/**
 * @author 袁进勇
 *
 */
public abstract class AbstractScheduleConsumer {
    @Resource
    private ScheduleImmediatelyPlanePickOrderService scheduleImmediatelyPlanePickOrderService;
    @Resource
    private ScheduleImmediatelyTrainPickOrderService scheduleImmediatelyTrainPickOrderService;
    @Resource
    private SchedulePlanPlanePickOrderService schedulePlanPlanePickOrderService;
    @Resource
    private SchedulePlanTrainPickOrderService schedulePlanTrainPickOrderService;
    @Resource
    private SchedulePlanPlaneSendOrderService schedulePlanPlaneSendOrderService;
    @Resource
    private SchedulePlanTrainSendOrderService schedulePlanTrainSendOrderService;
    @Resource
    private SchedulePlanCommonOrderService schedulePlanCommonOrderService;
    @Resource
    private ScheduleImmediatelyCommonOrderService scheduleImmediatelyCommonOrderService;

    protected ScheduleOrderService getScheduleOrderService(Integer orderType) {
        if (Cons.ORDER_TYPE_IMMEDIATELY_PLANE_PICK.equals(orderType)) { // 立即接机
            return scheduleImmediatelyPlanePickOrderService;
        } else if (Cons.ORDER_TYPE_IMMEDIATELY_TRAIN_PICK.equals(orderType)) { // 立即接站
            return scheduleImmediatelyTrainPickOrderService;
        } else if (Cons.ORDER_TYPE_PLAN_PLANE_PICK.equals(orderType)) { // 预约接机
            return schedulePlanPlanePickOrderService;
        } else if (Cons.ORDER_TYPE_PLAN_TRAIN_PICK.equals(orderType)) { // 预约接站
            return schedulePlanTrainPickOrderService;
        } else if (Cons.ORDER_TYPE_PLAN_PLANE_SEND.equals(orderType)) { // 预约送机
            return schedulePlanPlaneSendOrderService;
        } else if (Cons.ORDER_TYPE_PLAN_TRAIN_SEND.equals(orderType)) { // 预约送站
            return schedulePlanTrainSendOrderService;
        } else if (Cons.ORDER_TYPE_PLAN_COMMON.equals(orderType)) { // 预约用车
            return schedulePlanCommonOrderService;
        } else if (Cons.ORDER_TYPE_IMMEDIATELY_COMMON.equals(orderType)) { // 立即用车
            return scheduleImmediatelyCommonOrderService;
        } else {
            return null;
        }
    }
}
